package com.atguigu.myzhxy;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class shuzi {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<List<String>> lists = new ArrayList<>();
        for(int i=1;i<=n;i++){
            List<String> list = new ArrayList<>();
            int fh = firsthang(i);
            lists.forEach(x->{
                x.add(0,"    ");
            });
            for(int j=0;j<i;j++){
                String temp = fh++ + "***";
                list.add(temp.substring(0,4));
                if(j!=i-1){
                    list.add("    ");
                }
            }
            if((i)%2==0){
                Collections.reverse(list);
            }
            lists.add(list);
        }
        lists.forEach(x->{
            String res = "";
            for(int i=0;i<x.size();i++){
                res+=x.get(i);
            }
            System.out.println(res);
        });
    }
    public static int firsthang(int n){
        if(n==1){
            return 1;
        }
        return firsthang(n-1)+n-1;
    }

}
